/**
 * 进度状态接口
 */
export interface ProgressState {
  stage: ProgressStage
  message: string
  percentage: number
  details: string
  timestamp: number
  duration?: number
}

/**
 * 进度阶段枚举
 */
export enum ProgressStage {
  IDLE = 'idle',
  COLLECTING = 'collecting',
  ANALYZING = 'analyzing',
  RENDERING = 'rendering',
  COMPLETE = 'complete',
  ERROR = 'error',
  CANCELLED = 'cancelled',
}

/**
 * 进度事件类型
 */
export interface ProgressEvent {
  type: 'update' | 'complete' | 'error' | 'cancel'
  state: ProgressState
  previousState?: ProgressState
}

/**
 * 进度配置选项
 */
export interface ProgressOptions {
  containerSelector?: string
  autoHide?: boolean
  hideDelay?: number
  showPercentage?: boolean
  showDetails?: boolean
  animationDuration?: number
  logLevel?: 'debug' | 'info' | 'warn' | 'error'
  showElapsedTime?: boolean
  timeFormat?: 'auto' | 'seconds' | 'minutes' | 'humanized'
}

/**
 * 默认进度配置
 */
export const DEFAULT_PROGRESS_STATE: Required<ProgressOptions> = {
  containerSelector: 'body',
  autoHide: true,
  hideDelay: 2000,
  showPercentage: true,
  showDetails: true,
  animationDuration: 300,
  logLevel: 'info',
  showElapsedTime: true,
  timeFormat: 'auto',
}

/**
 * 进度步骤定义
 */
export interface ProgressStep {
  stage: ProgressStage
  targetPercentage: number
  defaultMessage: string
  icon?: string
  color?: string
}
